主题
登录 - Login
函数简介
用户登录授权系统,验证用户身份并注册插件功能。本接口登录成功会自动注册插件,不需要调用 Reg 接口重复注册,也不需要提前注册避免无效扣费。
返回数据格式:
json
{
"EndTime": "2026-01-30 11:40:41.193",
"LastVersion": "",
"LicenseType": 3,
"LicenseTypeStr": "月卡",
"Message": "",
"RemainingCount": 0,
"ServerTime": "2025-12-30 11:40:41.714",
"Status": 1,
}| 字段名 | 说明 |
|---|---|
| EndTime | 授权到期时间。 |
| LastVersion | 最新的版本号。 |
| LicenseType | 授权类型:0次卡,1小时卡,2日卡,3月卡,4年卡,5永久卡。 |
| LicenseTypeStr | 授权类型中文描述。 |
| Message | 提示信息。 |
| RemainingCount | 次卡剩余数量。 |
| ServerTime | 服务器时间。 |
| Status | 授权状态:1正常,0失败。 |
接口名称
LoginDLL调用
long Login(string userCode, string softCode, string featureList, string softVersion, string dealerCode);参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| userCode | 字符串 | 用户码。 |
| softCode | 字符串 | 软件码。 |
| featureList | 字符串 | 功能列表。为空时只使用授权系统,不注册插件。如OLA、YOLO等,多个特性用 | 分割,如使用YOLO功能 OLA|YOLO。 |
| softVersion | 字符串 | 软件版本。 |
| dealerCode | 字符串 | 经销商码。 |
示例
SDK 调用
cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
string result = ola.Login("userCode", "softCode", "featureList");
// result 为 JSON,含授权状态csharp
using OLAPlug;
var ola = new OLAPlugServer();
string result = ola.Login("userCode", "softCode", "featureList");
// result 为 JSON,含授权状态python
from OLAPlugServer import OLAPlugServer
ola = OLAPlugServer()
result = ola.Login("userCode", "softCode", "featureList")
# result 为 JSON,含授权状态java
import com.olaplug.OLAPlugServer;
OLAPlugServer ola = new OLAPlugServer();
String result = ola.Login("userCode", "softCode", "featureList");
// result 为 JSON,含授权状态cpp
var ola = com("OlaPlug.OlaSoft")
var result = ola.Login("userCode", "softCode", "featureList")
// result 为 JSON,含授权状态vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
result = ola.Login("userCode", "softCode", "featureList")
' result 为 JSON,含授权状态text
.局部变量 ola, OLAPlug
ola.创建 ()
result = ola.Login(“userCode“, “softCode“, “featureList“)
' result 为 JSON,含授权状态aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var result = ola.Login("userCode", "softCode", "featureList");
// result 为 JSON,含授权状态text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
文本型 result = ola.Login("userCode", "softCode", "featureList")
// result 为 JSON,含授权状态cpp
#include "OLAPlugServer.h"
OLAPlugServer ola;
string result = ola.Login("userCode", "softCode", "featureList");
// result 为 JSON,含授权状态原生 DLL 调用
cpp
long instance = CreateCOLAPlugInterFace();
long resultPtr = Login(instance, "userCode", "softCode", "featureList");
if (resultPtr != 0) {
char result[512] = {0};
GetStringFromPtr(resultPtr, result, sizeof(result));
FreeStringPtr(resultPtr);
}csharp
using System.Runtime.InteropServices;
using System.Text;
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int GetStringFromPtr(long ptr, StringBuilder lpString, int size);
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int FreeStringPtr(long ptr);
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern int GetStringSize(long ptr);
[DllImport("OLAPlug_x64.dll", CallingConvention = CallingConvention.StdCall)]
static extern long CreateCOLAPlugInterFace();
long instance = CreateCOLAPlugInterFace();
long resultPtr = Login(instance, "userCode", "softCode", "featureList");
if (resultPtr != 0) {
StringBuilder result = new StringBuilder(GetStringSize(resultPtr) + 1);
GetStringFromPtr(resultPtr, result, result.Capacity);
FreeStringPtr(resultPtr);
string resultStr = result.ToString();
}python
from ctypes import CDLL, c_int, c_int64, create_string_buffer
ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
resultPtr = Login(instance, "userCode", "softCode", "featureList")
if resultPtr:
buf = create_string_buffer(512)
ola.GetStringFromPtr(resultPtr, buf, 512)
ola.FreeStringPtr(resultPtr)
result = buf.value.decode("utf-8")返回值
成功返回JSON字符串格式的登录结果;失败返回 0。
注意事项
- 返回的字符串指针需要调用 FreeStringPtr 接口释放内存。
- 如果 featureList 参数为空,则只使用授权系统功能,不会注册相关插件功能。
- 用户码、软件码和经销商码需要从授权平台获取。
